<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Navo Portable Library: navo/algorithm/linear/sequence/slseq.h源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Navo Portable Library&#160;<span id="projectnumber">Ver 1.0.20120827</span></div>
   <div id="projectbrief">Provides generic platform independent facilities.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>数据结构</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>全局定义</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>navo/algorithm/linear/sequence/slseq.h</h1>  </div>
</div>
<div class="contents">
<a href="slseq_8h.html">浏览该文件的文档。</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */</span>
<a name="l00011"></a>00011 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#pragma once</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* #ifdef _MSC_VER */</span>
<a name="l00014"></a>00014 
<a name="l00015"></a>00015 <span class="preprocessor">#ifndef __NV_SLSEQ__</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define __NV_SLSEQ__</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &quot;<a class="code" href="cdef_8h.html" title="Definitions and declarations for common constants, types, variables.">../../../port/cdef.h</a>&quot;</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#include &lt;cstring&gt;</span>
<a name="l00022"></a>00022 <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00023"></a>00023 <span class="preprocessor">#else</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#endif </span><span class="comment">/* #ifdef __cplusplus */</span>
<a name="l00026"></a>00026 
<a name="l00038"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga7a044ba9003ba05a3de2cea88db65e07">00038</a> <span class="preprocessor">#define slseq_iter(type) type *</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00051"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gab7b8f6f20db0f3e5681fd2184b1ae60c">00051</a> <span class="preprocessor">#define slseq_head(type) \</span>
<a name="l00052"></a>00052 <span class="preprocessor">    struct { type * first; type * last; type * end; }</span>
<a name="l00053"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga83c98cc4a910b1fce204a9dd409383fb">00053</a> <span class="preprocessor"></span><span class="preprocessor">#define slseq slseq_head</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span>
<a name="l00065"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga72020d78ab6e8221b1fe395153e0f5ed">00065</a> <span class="preprocessor">#define SLSEQ_HEAD(type, name, arr) \</span>
<a name="l00066"></a>00066 <span class="preprocessor">    slseq_head(type) name = {arr, arr, &amp;arr[count_of(arr)]}</span>
<a name="l00067"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gabc7ae76112da39cad3a490ffe29a36d2">00067</a> <span class="preprocessor"></span><span class="preprocessor">#define SLSEQ SLSEQ_HEAD</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>
<a name="l00077"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gadc091f35bd93153cb4a60cdb0a48abef">00077</a> <span class="preprocessor">#define slseq_pr1(type) int (*)(type *)</span>
<a name="l00078"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gac263dee4595a10b58e55bf7e58881607">00078</a> <span class="preprocessor"></span><span class="preprocessor">#define slseq_pr2(type) int (*)(type *, type *)</span>
<a name="l00079"></a>00079 <span class="preprocessor"></span>
<a name="l00080"></a>00080 <span class="preprocessor">#define SLSEQ_CHECK_PASS        0 </span><span class="comment">/* 正常 */</span>
<a name="l00081"></a>00081 <span class="preprocessor">#define SLSEQ_CHECK_INVALID     1 </span><span class="comment">/* 无效缓存 */</span>
<a name="l00082"></a>00082 <span class="preprocessor">#define SLSEQ_CHECK_OVERFLOW    2 </span><span class="comment">/* 溢出 */</span>
<a name="l00083"></a>00083 
<a name="l00084"></a>00084 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> __slseq_check(<span class="keywordtype">char</span>* first, <span class="keywordtype">char</span>* last, <span class="keywordtype">char</span>* end)
<a name="l00085"></a>00085 {
<a name="l00086"></a>00086     <span class="keywordflow">if</span> (!first || first &gt;= end)
<a name="l00087"></a>00087         <span class="keywordflow">return</span> SLSEQ_CHECK_INVALID;
<a name="l00088"></a>00088     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (last &gt; end)
<a name="l00089"></a>00089         <span class="keywordflow">return</span> SLSEQ_CHECK_OVERFLOW;
<a name="l00090"></a>00090     <span class="keywordflow">else</span>
<a name="l00091"></a>00091         <span class="keywordflow">return</span> SLSEQ_CHECK_PASS;
<a name="l00092"></a>00092 }
<a name="l00093"></a>00093 
<a name="l00103"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga9d1c44ede3c9a75c58319a77a6ec819a">00103</a> <span class="preprocessor">#define slseq_check(head) \</span>
<a name="l00104"></a>00104 <span class="preprocessor">    __slseq_check((char*)((head)-&gt;first),   \</span>
<a name="l00105"></a>00105 <span class="preprocessor">                  (char*)((head)-&gt;last),    \</span>
<a name="l00106"></a>00106 <span class="preprocessor">                  (char*)((head)-&gt;end))</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span>
<a name="l00116"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga66ef4475adc758147d5aed6ea3056a4c">00116</a> <span class="preprocessor">#define slseq_reset(head, _first, _last, _end) \</span>
<a name="l00117"></a>00117 <span class="preprocessor">    do {(head)-&gt;first = (_first);    \</span>
<a name="l00118"></a>00118 <span class="preprocessor">        (head)-&gt;last = (_last);      \</span>
<a name="l00119"></a>00119 <span class="preprocessor">        (head)-&gt;end = (_end);        \</span>
<a name="l00120"></a>00120 <span class="preprocessor">    } while (0)</span>
<a name="l00121"></a>00121 <span class="preprocessor"></span>
<a name="l00131"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga3c4ad339e4584531edbf83514aa543e5">00131</a> <span class="preprocessor">#define slseq_init(type, head, base, size)              \</span>
<a name="l00132"></a>00132 <span class="preprocessor">    slseq_reset(head, (type *)(base), (type *)(base),   \</span>
<a name="l00133"></a>00133 <span class="preprocessor">                (type *)(base) + (size))                \</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span>
<a name="l00135"></a>00135 <span class="preprocessor"></span>
<a name="l00164"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga0a2be500364de1117b7aeff8448a5c46">00164</a> <span class="preprocessor">#define slseq_init_serial(type, head, base, size, cnt)  \</span>
<a name="l00165"></a>00165 <span class="preprocessor">    slseq_reset(head, (type *)(base),               \</span>
<a name="l00166"></a>00166 <span class="preprocessor">                (type *)(base) + (cnt),             \</span>
<a name="l00167"></a>00167 <span class="preprocessor">                (type *)(base) + (size))            \</span>
<a name="l00168"></a>00168 <span class="preprocessor"></span>
<a name="l00169"></a>00169 <span class="preprocessor"></span>
<a name="l00199"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga1d2ff5d1484cb5ee9d3f8c2e097e4ba6">00199</a> <span class="preprocessor">#define SLSEQ_INIT(type, head, arr) \</span>
<a name="l00200"></a>00200 <span class="preprocessor">    slseq_init(type, head, arr, count_of(arr))</span>
<a name="l00201"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga08213d0c7bcf381b466b18e3822c6934">00201</a> <span class="preprocessor"></span><span class="preprocessor">#define SLSEQ_INIT_SERIAL(type, head, arr, cnt) \</span>
<a name="l00202"></a>00202 <span class="preprocessor">    slseq_init_serial(type, head, arr, count_of(arr), cnt)</span>
<a name="l00203"></a>00203 <span class="preprocessor"></span>
<a name="l00209"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga307e2dd9b759efca6d7ce111828ce42f">00209</a> <span class="preprocessor">#define slseq_clear(head) ((head)-&gt;last = (head)-&gt;first)</span>
<a name="l00210"></a>00210 <span class="preprocessor"></span>
<a name="l00217"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaaf7079f9b34aee3f8683bd952221280c">00217</a> <span class="preprocessor">#define slseq_base(head) ((head)-&gt;first)</span>
<a name="l00218"></a>00218 <span class="preprocessor"></span>
<a name="l00225"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga40c042a8aab0f3a3e2cbec1aa71be240">00225</a> <span class="preprocessor">#define slseq_count(head) \</span>
<a name="l00226"></a>00226 <span class="preprocessor">    ((size_t)((head)-&gt;last - (head)-&gt;first))</span>
<a name="l00227"></a>00227 <span class="preprocessor"></span>
<a name="l00235"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga9f5fe365d6658fe43e91a1928dbd3506">00235</a> <span class="preprocessor">#define slseq_size(head) \</span>
<a name="l00236"></a>00236 <span class="preprocessor">    ((size_t)((head)-&gt;end - (head)-&gt;first))</span>
<a name="l00237"></a>00237 <span class="preprocessor"></span>
<a name="l00245"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga9d0bfd9f99636d2a61fae233bba3a945">00245</a> <span class="preprocessor">#define slseq_capacity(head) slseq_size(head)</span>
<a name="l00246"></a>00246 <span class="preprocessor"></span>
<a name="l00254"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga9eea604709265671b608b47938e1a376">00254</a> <span class="preprocessor">#define slseq_remain(head) \</span>
<a name="l00255"></a>00255 <span class="preprocessor">    ((size_t)((head)-&gt;end - (head)-&gt;last))</span>
<a name="l00256"></a>00256 <span class="preprocessor"></span>
<a name="l00266"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gae4268073051fcbb3e21b122065713cff">00266</a> <span class="preprocessor">#define slseq_empty(head) ((head)-&gt;first &gt;= (head)-&gt;last)</span>
<a name="l00267"></a>00267 <span class="preprocessor"></span>
<a name="l00277"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaa6bbfe2c0dca4dcf85c1a70990fe594c">00277</a> <span class="preprocessor">#define slseq_full(head) ((head)-&gt;last &gt;= (head)-&gt;end)</span>
<a name="l00278"></a>00278 <span class="preprocessor"></span>
<a name="l00287"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga0489678a9321eb40db61f65de80ff96f">00287</a> <span class="preprocessor">#define slseq_singular(head) \</span>
<a name="l00288"></a>00288 <span class="preprocessor">    ((head)-&gt;last == ((head)-&gt;first + 1))</span>
<a name="l00289"></a>00289 <span class="preprocessor"></span>
<a name="l00298"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga64411d864a8c05dbf91c1ada3ba1f131">00298</a> <span class="preprocessor">#define slseq_sortable(head) \</span>
<a name="l00299"></a>00299 <span class="preprocessor">    ((head)-&gt;last &gt; ((head)-&gt;first + 1))</span>
<a name="l00300"></a>00300 <span class="preprocessor"></span>
<a name="l00310"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaf13cef717587bc54d064f5d0b0766314">00310</a> <span class="preprocessor">#define slseq_insertable(head, cnt) \</span>
<a name="l00311"></a>00311 <span class="preprocessor">    ((head)-&gt;end &gt;= ((head)-&gt;last + (cnt)))</span>
<a name="l00312"></a>00312 <span class="preprocessor"></span>
<a name="l00321"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gafe64444f99f75fe1813b6a31a9c02297">00321</a> <span class="preprocessor">#define slseq_serialable(head) \</span>
<a name="l00322"></a>00322 <span class="preprocessor">    ((head)-&gt;last &gt; (head)-&gt;first)</span>
<a name="l00323"></a>00323 <span class="preprocessor"></span>
<a name="l00333"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gad1717496486cf96efa2b49bac7b65fcb">00333</a> <span class="preprocessor">#define slseq_copyable(dst, src) \</span>
<a name="l00334"></a>00334 <span class="preprocessor">    __slseq_copyable((char*)(dst),              \</span>
<a name="l00335"></a>00335 <span class="preprocessor">                     (char*)(src),              \</span>
<a name="l00336"></a>00336 <span class="preprocessor">                     (char*)((src)-&gt;first),     \</span>
<a name="l00337"></a>00337 <span class="preprocessor">                     (char*)((src)-&gt;last),      \</span>
<a name="l00338"></a>00338 <span class="preprocessor">                     (char*)((dst)-&gt;first),     \</span>
<a name="l00339"></a>00339 <span class="preprocessor">                     (char*)((dst)-&gt;end))</span>
<a name="l00340"></a>00340 <span class="preprocessor"></span>
<a name="l00341"></a>00341 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> __slseq_copyable(<span class="keywordtype">char</span>* dst, <span class="keywordtype">char</span>* src,
<a name="l00342"></a>00342                                    <span class="keywordtype">char</span>* s_first, <span class="keywordtype">char</span>* s_last,
<a name="l00343"></a>00343                                    <span class="keywordtype">char</span>* d_first, <span class="keywordtype">char</span>* d_end)
<a name="l00344"></a>00344 {
<a name="l00345"></a>00345     <span class="keywordflow">return</span> (dst != src &amp;&amp; (s_last &gt; s_first) &amp;&amp;
<a name="l00346"></a>00346          (d_end - d_first) &gt;= (s_last - s_first));
<a name="l00347"></a>00347 }
<a name="l00348"></a>00348 
<a name="l00355"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gae27fe82da920e5b073e27f8e5ed3c69c">00355</a> <span class="preprocessor">#define slseq_at(head, index) ((head)-&gt;first + (index))</span>
<a name="l00356"></a>00356 <span class="preprocessor"></span>
<a name="l00364"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga3c6e3aa9351796900e0d28dce2988f45">00364</a> <span class="preprocessor">#define slseq_reverse_at(head, index) \</span>
<a name="l00365"></a>00365 <span class="preprocessor">    ((head)-&gt;last - ((index) + 1))</span>
<a name="l00366"></a>00366 <span class="preprocessor"></span>
<a name="l00373"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga1861e997fcddc32c22f346db83f6a28e">00373</a> <span class="preprocessor">#define slseq_index_of(head, itr) ((itr) - (head)-&gt;first)</span>
<a name="l00374"></a>00374 <span class="preprocessor"></span>
<a name="l00382"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga92b2525c6ccdee41ee4b90fa5fcfeaa3">00382</a> <span class="preprocessor">#define slseq_reverse_index_of(head, itr) \</span>
<a name="l00383"></a>00383 <span class="preprocessor">    ((head)-&gt;last - ((itr) + 1))</span>
<a name="l00384"></a>00384 <span class="preprocessor"></span>
<a name="l00394"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga67e3a970b40b8bd19b2882cf840e764b">00394</a> <span class="preprocessor">#define slseq_exist(head, itr) \</span>
<a name="l00395"></a>00395 <span class="preprocessor">    __slseq_exist((char*)((head)-&gt;first),   \</span>
<a name="l00396"></a>00396 <span class="preprocessor">                  (char*)((head)-&gt;last),    \</span>
<a name="l00397"></a>00397 <span class="preprocessor">                  (char*)(itr))</span>
<a name="l00398"></a>00398 <span class="preprocessor"></span>
<a name="l00399"></a>00399 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> __slseq_exist(<span class="keywordtype">char</span>* first, <span class="keywordtype">char</span>* last, <span class="keywordtype">char</span>* itr)
<a name="l00400"></a>00400 {
<a name="l00401"></a>00401     <span class="keywordflow">return</span> itr &gt;= first &amp;&amp; itr &lt; last;
<a name="l00402"></a>00402 }
<a name="l00403"></a>00403 
<a name="l00412"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaaad5b820f6d275327a9fa2a798f44fff">00412</a> <span class="preprocessor">#define slseq_distance(first, last) ((size_t)((last) - (first)) + 1)</span>
<a name="l00413"></a>00413 <span class="preprocessor"></span>
<a name="l00423"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga7c03b922ae6e488f1bf8c46b58c9ef2a">00423</a> <span class="preprocessor">#define slseq_insert(type, head, pos, newly) do {   \</span>
<a name="l00424"></a>00424 <span class="preprocessor">        type * _q_p = (type *)(pos);                \</span>
<a name="l00425"></a>00425 <span class="preprocessor">        memmove(_q_p + 1, _q_p, sizeof(type) *     \</span>
<a name="l00426"></a>00426 <span class="preprocessor">            ((head)-&gt;last++ - _q_p));              \</span>
<a name="l00427"></a>00427 <span class="preprocessor">        *_q_p = (newly);                            \</span>
<a name="l00428"></a>00428 <span class="preprocessor">    } while (0)</span>
<a name="l00429"></a>00429 <span class="preprocessor"></span>
<a name="l00437"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga5df72a88d5d650cc39071cbe6cb0622c">00437</a> <span class="preprocessor">#define slseq_erase(type, head, pos) do {       \</span>
<a name="l00438"></a>00438 <span class="preprocessor">        type * _q_p = (type *)(pos);            \</span>
<a name="l00439"></a>00439 <span class="preprocessor">        memcpy(_q_p, _q_p + 1, sizeof(type) *  \</span>
<a name="l00440"></a>00440 <span class="preprocessor">            ((--(head)-&gt;last) - _q_p));        \</span>
<a name="l00441"></a>00441 <span class="preprocessor">    } while (0)</span>
<a name="l00442"></a>00442 <span class="preprocessor"></span>
<a name="l00461"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga1677c06cc848f559a4dcdc4405b33311">00461</a> <span class="preprocessor">#define slseq_inserts(type, head, pos, src, cnt) do {   \</span>
<a name="l00462"></a>00462 <span class="preprocessor">        size_t _q_c = (cnt);                            \</span>
<a name="l00463"></a>00463 <span class="preprocessor">        type * _q_sb = (type *)(src);                   \</span>
<a name="l00464"></a>00464 <span class="preprocessor">        type * _q_p = (type *)(pos);                    \</span>
<a name="l00465"></a>00465 <span class="preprocessor">        memmove(_q_p + _q_c, _q_p, sizeof(type) *      \</span>
<a name="l00466"></a>00466 <span class="preprocessor">            ((head)-&gt;last - _q_p));                    \</span>
<a name="l00467"></a>00467 <span class="preprocessor">        memcpy(_q_p, _q_sb, sizeof(type) * _q_c);       \</span>
<a name="l00468"></a>00468 <span class="preprocessor">        (head)-&gt;last += _q_c;                           \</span>
<a name="l00469"></a>00469 <span class="preprocessor">    } while (0)</span>
<a name="l00470"></a>00470 <span class="preprocessor"></span>
<a name="l00479"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaaf8c04109eb7af201387e220ab585a55">00479</a> <span class="preprocessor">#define slseq_erases(type, head, begin, end) do {   \</span>
<a name="l00480"></a>00480 <span class="preprocessor">        type * _q_e = (type *)(end);                \</span>
<a name="l00481"></a>00481 <span class="preprocessor">        type * _q_f = (type *)(begin);              \</span>
<a name="l00482"></a>00482 <span class="preprocessor">        memcpy(_q_f, _q_e, sizeof(type) *          \</span>
<a name="l00483"></a>00483 <span class="preprocessor">            ((head)-&gt;last - _q_e));                \</span>
<a name="l00484"></a>00484 <span class="preprocessor">        (head)-&gt;last -= (_q_e - _q_f);              \</span>
<a name="l00485"></a>00485 <span class="preprocessor">    } while (0)</span>
<a name="l00486"></a>00486 <span class="preprocessor"></span>
<a name="l00498"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga5940c6a04d0980389745c1efa1aaa979">00498</a> <span class="preprocessor">#define slseq_splice(type, dst, pos, src, _first, _last) \</span>
<a name="l00499"></a>00499 <span class="preprocessor">    do {type * _q_e = (type *)(_last) + 1;              \</span>
<a name="l00500"></a>00500 <span class="preprocessor">        type * _q_f = (type *)(_first);                 \</span>
<a name="l00501"></a>00501 <span class="preprocessor">        type * _q_p = (type *)(pos);                    \</span>
<a name="l00502"></a>00502 <span class="preprocessor">        size_t _q_c = _q_e - _q_f;                      \</span>
<a name="l00503"></a>00503 <span class="preprocessor">        memmove(_q_p + _q_c, _q_p, sizeof(type) *      \</span>
<a name="l00504"></a>00504 <span class="preprocessor">            ((dst)-&gt;last - _q_p));                     \</span>
<a name="l00505"></a>00505 <span class="preprocessor">        memcpy(_q_p, _q_f, sizeof(type) * _q_c);        \</span>
<a name="l00506"></a>00506 <span class="preprocessor">        memcpy(_q_f, _q_f + _q_c, sizeof(type) *       \</span>
<a name="l00507"></a>00507 <span class="preprocessor">            ((src)-&gt;last - _q_e));                     \</span>
<a name="l00508"></a>00508 <span class="preprocessor">        (src)-&gt;last -= _q_c;                            \</span>
<a name="l00509"></a>00509 <span class="preprocessor">        (dst)-&gt;last += _q_c;                            \</span>
<a name="l00510"></a>00510 <span class="preprocessor">    } while (0)</span>
<a name="l00511"></a>00511 <span class="preprocessor"></span>
<a name="l00528"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gae6d218d7f4e92811ca480f52d698e9fe">00528</a> <span class="preprocessor">#define slseq_appends(type, head, src, cnt) do {        \</span>
<a name="l00529"></a>00529 <span class="preprocessor">        size_t _q_c = (cnt);                            \</span>
<a name="l00530"></a>00530 <span class="preprocessor">        memcpy((head)-&gt;last, src, sizeof(type) * _q_c); \</span>
<a name="l00531"></a>00531 <span class="preprocessor">        (head)-&gt;last += _q_c;                           \</span>
<a name="l00532"></a>00532 <span class="preprocessor">    } while (0)</span>
<a name="l00533"></a>00533 <span class="preprocessor"></span>
<a name="l00541"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga224d22084859961800f30a0607d7a7c2">00541</a> <span class="preprocessor">#define slseq_append(head, newly) \</span>
<a name="l00542"></a>00542 <span class="preprocessor">    (*((head)-&gt;last++) = (newly))</span>
<a name="l00543"></a>00543 <span class="preprocessor"></span>
<a name="l00559"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga33999e7a0285c444ce27297e786e23af">00559</a> <span class="preprocessor">#define slseq_copy(type, dst, src) do {         \</span>
<a name="l00560"></a>00560 <span class="preprocessor">        size_t _q_c = slseq_count(src);         \</span>
<a name="l00561"></a>00561 <span class="preprocessor">        memcpy((dst)-&gt;first, (src)-&gt;first,      \</span>
<a name="l00562"></a>00562 <span class="preprocessor">            sizeof(type) * _q_c);               \</span>
<a name="l00563"></a>00563 <span class="preprocessor">        (dst)-&gt;last = (dst)-&gt;first + _q_c;      \</span>
<a name="l00564"></a>00564 <span class="preprocessor">    } while (0)</span>
<a name="l00565"></a>00565 <span class="preprocessor"></span>
<a name="l00578"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gae1494928c2cf16eb8b6975318f492f1c">00578</a> <span class="preprocessor">#define slseq_push_back(head) ((head)-&gt;last++)</span>
<a name="l00579"></a>00579 <span class="preprocessor"></span>
<a name="l00592"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga2a34300fb1024bdb7a96c19c36f5af34">00592</a> <span class="preprocessor">#define slseq_pop_back(head) (--(head)-&gt;last)</span>
<a name="l00593"></a>00593 <span class="preprocessor"></span>
<a name="l00600"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gae38030bc268572393c04e9721f8ff285">00600</a> <span class="preprocessor">#define slseq_iter_replace(victim, newly) (*(victim) = (newly))</span>
<a name="l00601"></a>00601 <span class="preprocessor"></span>
<a name="l00602"></a>00602 <span class="preprocessor">#define __slseq_iter_swap(type, a, b) do {\</span>
<a name="l00603"></a>00603 <span class="preprocessor">    type _q_t = *(a); *(a) = *(b); *(b) = _q_t; } while (0)</span>
<a name="l00604"></a>00604 <span class="preprocessor"></span>
<a name="l00612"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gae27918a0c5b158a22dee769f063921ae">00612</a> <span class="preprocessor">#define slseq_iter_swap(type, a, b) do {        \</span>
<a name="l00613"></a>00613 <span class="preprocessor">        type * _q_b = (b); type * _q_a = (a);   \</span>
<a name="l00614"></a>00614 <span class="preprocessor">        __slseq_iter_swap(type, _q_a, _q_b);    \</span>
<a name="l00615"></a>00615 <span class="preprocessor">    } while (0)</span>
<a name="l00616"></a>00616 <span class="preprocessor"></span>
<a name="l00623"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga155890eb273f29f74bac3143af5030d8">00623</a> <span class="preprocessor">#define slseq_replace(victim, newly) (*(victim) = *(newly))</span>
<a name="l00624"></a>00624 <span class="preprocessor"></span>
<a name="l00632"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga809343daf7d6e11e225b842b762078f3">00632</a> <span class="preprocessor">#define slseq_swap(type, a, b) do { \</span>
<a name="l00633"></a>00633 <span class="preprocessor">        slseq_head(type) t = *(a);  \</span>
<a name="l00634"></a>00634 <span class="preprocessor">        *(a) = *(b); *(b) = t;      \</span>
<a name="l00635"></a>00635 <span class="preprocessor">    } while (0)</span>
<a name="l00636"></a>00636 <span class="preprocessor"></span>
<a name="l00643"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gad934bf5c6108112fbaef444484c71c43">00643</a> <span class="preprocessor">#define slseq_front(head) ((head)-&gt;first)</span>
<a name="l00644"></a>00644 <span class="preprocessor"></span>
<a name="l00652"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gad58e7ccc25501ae4bfabbecb9321a313">00652</a> <span class="preprocessor">#define slseq_back(head) ((head)-&gt;last - 1)</span>
<a name="l00653"></a>00653 <span class="preprocessor"></span>
<a name="l00670"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga2696503718b3292109d395da44c988b6">00670</a> <span class="preprocessor">#define slseq_begin(head) slseq_front(head)</span>
<a name="l00671"></a>00671 <span class="preprocessor"></span>
<a name="l00679"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga5b3212d3b18809e193c701f7c6fef755">00679</a> <span class="preprocessor">#define slseq_end(head) ((head)-&gt;last)</span>
<a name="l00680"></a>00680 <span class="preprocessor"></span>
<a name="l00688"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga072a06523aa90f633d5668dbbe5c6817">00688</a> <span class="preprocessor">#define slseq_end_of(itr) ((itr) + 1)</span>
<a name="l00689"></a>00689 <span class="preprocessor"></span>
<a name="l00697"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gafcabee0dca463e6c33ecb77df3592abd">00697</a> <span class="preprocessor">#define slseq_rbegin(head) slseq_back(head)</span>
<a name="l00698"></a>00698 <span class="preprocessor"></span>
<a name="l00705"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaaabcd8478811a31b7b50e8dcdcfad0ae">00705</a> <span class="preprocessor">#define slseq_rend(head) ((head)-&gt;first - 1)</span>
<a name="l00706"></a>00706 <span class="preprocessor"></span>
<a name="l00714"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga676a8e963b9b96901e3beb6951f4129c">00714</a> <span class="preprocessor">#define slseq_rend_of(itr) ((itr) - 1)</span>
<a name="l00715"></a>00715 <span class="preprocessor"></span>
<a name="l00723"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga8c8b52691001770ceeee02de73ce8202">00723</a> <span class="preprocessor">#define slseq_next(itr) ((itr) + 1)</span>
<a name="l00724"></a>00724 <span class="preprocessor"></span>
<a name="l00732"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaf6d12385b5949b487f1643a1207bffca">00732</a> <span class="preprocessor">#define slseq_prev(itr) ((itr) - 1)</span>
<a name="l00733"></a>00733 <span class="preprocessor"></span>
<a name="l00741"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga2a644ab476a2a1180471a5770100a30a">00741</a> <span class="preprocessor">#define slseq_advance(cur, dist) ((cur) + (dist))</span>
<a name="l00742"></a>00742 <span class="preprocessor"></span>
<a name="l00767"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga7746110512440a11fca7377f485d5e9e">00767</a> <span class="preprocessor">#define SLSEQ_NOT_END(itr, end)     ((itr) &lt; (end))</span>
<a name="l00768"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga52cfe1d31c72d01e1f94fa5cc629993d">00768</a> <span class="preprocessor"></span><span class="preprocessor">#define SLSEQ_NOT_REND(itr, rend)   ((itr) &gt; (rend))</span>
<a name="l00769"></a>00769 <span class="preprocessor"></span>
<a name="l00800"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga362a73c9e604923921dc578accf6dcc4">00800</a> <span class="preprocessor">#define slseq_inc(itr)              (++(itr))</span>
<a name="l00801"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga90c54c4552eba1e8b8b8e42421cc17dc">00801</a> <span class="preprocessor"></span><span class="preprocessor">#define slseq_dec(itr)              (--(itr))</span>
<a name="l00802"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga752433853f94de425cd69f8dedaa907f">00802</a> <span class="preprocessor"></span><span class="preprocessor">#define slseq_add(itr, cnt)         ((itr) += (cnt))</span>
<a name="l00803"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga989d3cb91a502f095d5db846a1c91066">00803</a> <span class="preprocessor"></span><span class="preprocessor">#define slseq_sub(itr, cnt)         ((itr) -= (cnt))</span>
<a name="l00804"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gafeb17b73be7582c8ff2b6913d8523edf">00804</a> <span class="preprocessor"></span><span class="preprocessor">#define slseq_inc_later(itr)        ((itr)++)</span>
<a name="l00805"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gab775f9b4385a16da1e2f14a55ae4886d">00805</a> <span class="preprocessor"></span><span class="preprocessor">#define slseq_dec_later(itr)        ((itr)--)</span>
<a name="l00806"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaa3925356d203b514fde4d703707d9221">00806</a> <span class="preprocessor"></span><span class="preprocessor">#define slseq_add_later(itr, cnt)   (slseq_add(itr, cnt) - (cnt))</span>
<a name="l00807"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga9fb3969b6bad526bbf0914940027326f">00807</a> <span class="preprocessor"></span><span class="preprocessor">#define slseq_sub_later(itr, cnt)   (slseq_sub(itr, cnt) + (cnt))</span>
<a name="l00808"></a>00808 <span class="preprocessor"></span>
<a name="l00818"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga24695fd9a3ffb4a0092e811be90fc3bd">00818</a> <span class="preprocessor">#define slseq_foreach(type, begin, end, fn) \</span>
<a name="l00819"></a>00819 <span class="preprocessor">    do {type * _q_e = (type *)(end);        \</span>
<a name="l00820"></a>00820 <span class="preprocessor">        type * _q_f = (type *)(begin);      \</span>
<a name="l00821"></a>00821 <span class="preprocessor">        while (_q_f &lt; _q_e) {               \</span>
<a name="l00822"></a>00822 <span class="preprocessor">            fn(_q_f);                       \</span>
<a name="l00823"></a>00823 <span class="preprocessor">            ++_q_f;                         \</span>
<a name="l00824"></a>00824 <span class="preprocessor">        }                                   \</span>
<a name="l00825"></a>00825 <span class="preprocessor">    } while(0)</span>
<a name="l00826"></a>00826 <span class="preprocessor"></span>
<a name="l00836"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaa5503fd583f692591ddac9230197a3f3">00836</a> <span class="preprocessor">#define slseq_reverse_foreach(type, rbegin, rend, fn) \</span>
<a name="l00837"></a>00837 <span class="preprocessor">    do {type * _q_e = (type *)(rend);       \</span>
<a name="l00838"></a>00838 <span class="preprocessor">        type * _q_f = (type *)(rbegin);     \</span>
<a name="l00839"></a>00839 <span class="preprocessor">        while (_q_f &gt; _q_e) {               \</span>
<a name="l00840"></a>00840 <span class="preprocessor">            fn(_q_f);                       \</span>
<a name="l00841"></a>00841 <span class="preprocessor">            --_q_f;                         \</span>
<a name="l00842"></a>00842 <span class="preprocessor">        }                                   \</span>
<a name="l00843"></a>00843 <span class="preprocessor">    } while(0)</span>
<a name="l00844"></a>00844 <span class="preprocessor"></span>
<a name="l00857"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga6feddc27636a8ccb83b1390213015f98">00857</a> <span class="preprocessor">#define slseq_search(type, begin, end, equal, var, res) \</span>
<a name="l00858"></a>00858 <span class="preprocessor">    do {type _q_t = (var);                          \</span>
<a name="l00859"></a>00859 <span class="preprocessor">        type * _q_e = (end);                        \</span>
<a name="l00860"></a>00860 <span class="preprocessor">        type * _q_f = (begin);                      \</span>
<a name="l00861"></a>00861 <span class="preprocessor">        (res) = NULL;                               \</span>
<a name="l00862"></a>00862 <span class="preprocessor">        while (_q_f &lt; _q_e) {                       \</span>
<a name="l00863"></a>00863 <span class="preprocessor">            type * _q_cb = _q_f++;                  \</span>
<a name="l00864"></a>00864 <span class="preprocessor">            if (equal(_q_cb, (&amp;_q_t))) {            \</span>
<a name="l00865"></a>00865 <span class="preprocessor">                (res) = _q_cb;                      \</span>
<a name="l00866"></a>00866 <span class="preprocessor">                break;                              \</span>
<a name="l00867"></a>00867 <span class="preprocessor">            }                                       \</span>
<a name="l00868"></a>00868 <span class="preprocessor">        }                                           \</span>
<a name="l00869"></a>00869 <span class="preprocessor">    } while (0)</span>
<a name="l00870"></a>00870 <span class="preprocessor"></span>
<a name="l00883"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaef8a9c932289d1c849c301cd60be07f9">00883</a> <span class="preprocessor">#define slseq_binary_search(type, begin, end, greater, var, res) \</span>
<a name="l00884"></a>00884 <span class="preprocessor">    do {type _q_t = (var);                                  \</span>
<a name="l00885"></a>00885 <span class="preprocessor">        type * _q_e = (end);                                \</span>
<a name="l00886"></a>00886 <span class="preprocessor">        type * _q_f = (begin);                              \</span>
<a name="l00887"></a>00887 <span class="preprocessor">        (res) = NULL;                                       \</span>
<a name="l00888"></a>00888 <span class="preprocessor">        while (_q_f &lt; _q_e) {                               \</span>
<a name="l00889"></a>00889 <span class="preprocessor">            type * _q_m = _q_f + ((_q_e - _q_f) &gt;&gt; 1);      \</span>
<a name="l00890"></a>00890 <span class="preprocessor">            if (greater(_q_m, (&amp;_q_t))) {                   \</span>
<a name="l00891"></a>00891 <span class="preprocessor">                _q_e = _q_m;                                \</span>
<a name="l00892"></a>00892 <span class="preprocessor">            } else if (greater((&amp;_q_t), _q_m)) {            \</span>
<a name="l00893"></a>00893 <span class="preprocessor">                _q_f = _q_m + 1;                            \</span>
<a name="l00894"></a>00894 <span class="preprocessor">            } else {                                        \</span>
<a name="l00895"></a>00895 <span class="preprocessor">                (res) = _q_m;                               \</span>
<a name="l00896"></a>00896 <span class="preprocessor">                break;                                      \</span>
<a name="l00897"></a>00897 <span class="preprocessor">            }                                               \</span>
<a name="l00898"></a>00898 <span class="preprocessor">        }                                                   \</span>
<a name="l00899"></a>00899 <span class="preprocessor">    } while (0)</span>
<a name="l00900"></a>00900 <span class="preprocessor"></span>
<a name="l00901"></a>00901 <span class="comment">/* 反转序表的两种方式：</span>
<a name="l00902"></a>00902 <span class="comment"> * (1) 直接使用 slseq_reverse(元素类型, head); (推荐)</span>
<a name="l00903"></a>00903 <span class="comment"> * (2) 按照如下方式迭代</span>
<a name="l00904"></a>00904 <span class="comment"> *     slseq_iter(int) i = slseq_vbegin(head);</span>
<a name="l00905"></a>00905 <span class="comment"> *     slseq_iter(int) j = slseq_rvbegin(head);</span>
<a name="l00906"></a>00906 <span class="comment"> *     slseq_iter(int) e = slseq_vend(head);</span>
<a name="l00907"></a>00907 <span class="comment"> *     while (i &lt; e) {</span>
<a name="l00908"></a>00908 <span class="comment"> *          slseq_vswap(元素类型, i, j);</span>
<a name="l00909"></a>00909 <span class="comment"> *     }</span>
<a name="l00910"></a>00910 <span class="comment"> *     当迭代完成时，反转完成</span>
<a name="l00911"></a>00911 <span class="comment"> */</span>
<a name="l00912"></a>00912 
<a name="l00934"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gac2bad4a0dbf36abc1f97860ac4dff4d1">00934</a> <span class="preprocessor">#define slseq_vbegin(head)      slseq_begin(head)</span>
<a name="l00935"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gab671555a3c9684029f9c757460a9c8de">00935</a> <span class="preprocessor"></span><span class="preprocessor">#define slseq_rvbegin(head)     slseq_rbegin(head)</span>
<a name="l00936"></a>00936 <span class="preprocessor"></span>
<a name="l00954"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaacc509b14a99b31e04d044a67306f204">00954</a> <span class="preprocessor">#define slseq_vend(head) \</span>
<a name="l00955"></a>00955 <span class="preprocessor">    ((head)-&gt;first + (slseq_count(head) &gt;&gt; 1))</span>
<a name="l00956"></a>00956 <span class="preprocessor"></span>
<a name="l00957"></a>00957 <span class="preprocessor">#define slseq_vnext(i, r) do { ++(i); --(r); } while (0)</span>
<a name="l00958"></a>00958 <span class="preprocessor"></span>
<a name="l00977"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gab8a2257cf059d72e930581d659687695">00977</a> <span class="preprocessor">#define slseq_vswap(type, i, r) do {    \</span>
<a name="l00978"></a>00978 <span class="preprocessor">        __slseq_iter_swap(type, i, r);  \</span>
<a name="l00979"></a>00979 <span class="preprocessor">        slseq_vnext(i, r);              \</span>
<a name="l00980"></a>00980 <span class="preprocessor">    } while (0)</span>
<a name="l00981"></a>00981 <span class="preprocessor"></span>
<a name="l00989"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaac1b58126ec18227b09448b593659398">00989</a> <span class="preprocessor">#define slseq_reverse(type, head) do {          \</span>
<a name="l00990"></a>00990 <span class="preprocessor">        type * _q_e = slseq_vend(head);         \</span>
<a name="l00991"></a>00991 <span class="preprocessor">        type * _q_i = slseq_vbegin(head);       \</span>
<a name="l00992"></a>00992 <span class="preprocessor">        type * _q_j = slseq_rvbegin(head);      \</span>
<a name="l00993"></a>00993 <span class="preprocessor">        while (_q_i &lt; _q_e)                     \</span>
<a name="l00994"></a>00994 <span class="preprocessor">            slseq_vswap(type, _q_i, _q_j);      \</span>
<a name="l00995"></a>00995 <span class="preprocessor">    } while (0)</span>
<a name="l00996"></a>00996 <span class="preprocessor"></span>
<a name="l01006"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga2dc4fe12273073902e09f5008be43d34">01006</a> <span class="preprocessor">#define slseq_fill(type, begin, end, val) \</span>
<a name="l01007"></a>01007 <span class="preprocessor">    do {type _q_v = (val);      \</span>
<a name="l01008"></a>01008 <span class="preprocessor">        type * _q_e = (end);    \</span>
<a name="l01009"></a>01009 <span class="preprocessor">        type * _q_f = (begin);  \</span>
<a name="l01010"></a>01010 <span class="preprocessor">        while (_q_f &lt; _q_e)     \</span>
<a name="l01011"></a>01011 <span class="preprocessor">            *_q_f++ = _q_v;     \</span>
<a name="l01012"></a>01012 <span class="preprocessor">    } while (0)</span>
<a name="l01013"></a>01013 <span class="preprocessor"></span>
<a name="l01023"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gae243693efbc736ed5ad1e42361dc1bdd">01023</a> <span class="preprocessor">#define slseq_generate(type, begin, end, generator) \</span>
<a name="l01024"></a>01024 <span class="preprocessor">    do {type * _q_e = (end);        \</span>
<a name="l01025"></a>01025 <span class="preprocessor">        type * _q_f = (begin);      \</span>
<a name="l01026"></a>01026 <span class="preprocessor">        while (_q_f &lt; _q_e)         \</span>
<a name="l01027"></a>01027 <span class="preprocessor">            *_q_f++ = (generator);  \</span>
<a name="l01028"></a>01028 <span class="preprocessor">    } while (0)</span>
<a name="l01029"></a>01029 <span class="preprocessor"></span>
<a name="l01042"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga5f24e9af484f1657f09fb61b7ea20b6d">01042</a> <span class="preprocessor">#define slseq_is_heap(type, begin, end, greater, res)   \</span>
<a name="l01043"></a>01043 <span class="preprocessor">    do {type * _q_e = (end);                            \</span>
<a name="l01044"></a>01044 <span class="preprocessor">        type * _q_f = (begin);                          \</span>
<a name="l01045"></a>01045 <span class="preprocessor">        size_t _q_c = _q_e - _q_f;                      \</span>
<a name="l01046"></a>01046 <span class="preprocessor">        type * _q_b = _q_f + ((_q_c - 1) &gt;&gt; 1);         \</span>
<a name="l01047"></a>01047 <span class="preprocessor">        type * _q_p = _q_f;                             \</span>
<a name="l01048"></a>01048 <span class="preprocessor">        type * _q_i = _q_f + 1;                         \</span>
<a name="l01049"></a>01049 <span class="preprocessor">        for ((res) = 1; _q_b-- &gt; _q_f; ++_q_p) {        \</span>
<a name="l01050"></a>01050 <span class="preprocessor">            __slseq_ret_gt(_q_i, _q_p, res, greater);   \</span>
<a name="l01051"></a>01051 <span class="preprocessor">            __slseq_ret_gt(_q_i, _q_p, res, greater);   \</span>
<a name="l01052"></a>01052 <span class="preprocessor">        }                                               \</span>
<a name="l01053"></a>01053 <span class="preprocessor">        if (_q_i &lt; _q_e &amp;&amp; (greater(_q_i, _q_p))) {    \</span>
<a name="l01054"></a>01054 <span class="preprocessor">            (res) = 0; break;                           \</span>
<a name="l01055"></a>01055 <span class="preprocessor">        }                                               \</span>
<a name="l01056"></a>01056 <span class="preprocessor">    } while (0)</span>
<a name="l01057"></a>01057 <span class="preprocessor"></span>
<a name="l01058"></a>01058 <span class="preprocessor">#define __slseq_ret_gt(i, j, r, greater) \</span>
<a name="l01059"></a>01059 <span class="preprocessor">    if (greater((i), (j))) { (r) = 0; break; } ++(i)</span>
<a name="l01060"></a>01060 <span class="preprocessor"></span>
<a name="l01078"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga2f52f1faf4a8b433d5cb46552a3d67de">01078</a> <span class="preprocessor">#define slseq_push_heap(type, begin, end, greater) do { \</span>
<a name="l01079"></a>01079 <span class="preprocessor">        type * _q_l = (type *)(end) - 1;                \</span>
<a name="l01080"></a>01080 <span class="preprocessor">        type * _q_f = (type *)(begin);                  \</span>
<a name="l01081"></a>01081 <span class="preprocessor">        size_t _q_i = _q_l - _q_f;                      \</span>
<a name="l01082"></a>01082 <span class="preprocessor">        size_t _q_p = (_q_i - 1) &gt;&gt; 1;                  \</span>
<a name="l01083"></a>01083 <span class="preprocessor">        type * _q_ib = _q_f + _q_i;                     \</span>
<a name="l01084"></a>01084 <span class="preprocessor">        type * _q_pb = _q_f + _q_p;                     \</span>
<a name="l01085"></a>01085 <span class="preprocessor">        type _q_t = *_q_ib;                             \</span>
<a name="l01086"></a>01086 <span class="preprocessor">        while (_q_i &amp;&amp; (greater((&amp;_q_t), _q_pb))) {   \</span>
<a name="l01087"></a>01087 <span class="preprocessor">            *_q_ib = *_q_pb;                            \</span>
<a name="l01088"></a>01088 <span class="preprocessor">            _q_ib = _q_pb;                              \</span>
<a name="l01089"></a>01089 <span class="preprocessor">            _q_i = _q_p;                                \</span>
<a name="l01090"></a>01090 <span class="preprocessor">            _q_p = (_q_p - 1) &gt;&gt; 1;                     \</span>
<a name="l01091"></a>01091 <span class="preprocessor">            _q_pb = _q_f + _q_p;                        \</span>
<a name="l01092"></a>01092 <span class="preprocessor">        }                                               \</span>
<a name="l01093"></a>01093 <span class="preprocessor">        *_q_ib = _q_t;                                  \</span>
<a name="l01094"></a>01094 <span class="preprocessor">    } while (0)</span>
<a name="l01095"></a>01095 <span class="preprocessor"></span>
<a name="l01111"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga65dd21fdced82803b3508415606ab67c">01111</a> <span class="preprocessor">#define slseq_pop_heap(type, begin, end, greater) do {  \</span>
<a name="l01112"></a>01112 <span class="preprocessor">        type * _q_l = (type *)(end) - 1;                \</span>
<a name="l01113"></a>01113 <span class="preprocessor">        type * _q_f = (type *)(begin);                  \</span>
<a name="l01114"></a>01114 <span class="preprocessor">        type * _q_pb = _q_f;                            \</span>
<a name="l01115"></a>01115 <span class="preprocessor">        type * _q_ib, * _q_jb;                          \</span>
<a name="l01116"></a>01116 <span class="preprocessor">        type _q_t = *_q_pb;                             \</span>
<a name="l01117"></a>01117 <span class="preprocessor">        size_t _q_p = 0, _q_j = 2;                      \</span>
<a name="l01118"></a>01118 <span class="preprocessor">        size_t _q_L = _q_l - _q_f;                      \</span>
<a name="l01119"></a>01119 <span class="preprocessor">        for (; _q_j &lt;= _q_L; _q_j = (_q_p + 1) &lt;&lt; 1) {  \</span>
<a name="l01120"></a>01120 <span class="preprocessor">            _q_jb = _q_f + _q_j;                        \</span>
<a name="l01121"></a>01121 <span class="preprocessor">            _q_ib = _q_jb - 1;                          \</span>
<a name="l01122"></a>01122 <span class="preprocessor">            if (greater(_q_jb, _q_ib)) {                \</span>
<a name="l01123"></a>01123 <span class="preprocessor">                *_q_pb = *_q_jb;                        \</span>
<a name="l01124"></a>01124 <span class="preprocessor">                _q_pb = _q_jb;                          \</span>
<a name="l01125"></a>01125 <span class="preprocessor">                _q_p = _q_j;                            \</span>
<a name="l01126"></a>01126 <span class="preprocessor">            } else {                                    \</span>
<a name="l01127"></a>01127 <span class="preprocessor">                *_q_pb = *_q_ib;                        \</span>
<a name="l01128"></a>01128 <span class="preprocessor">                _q_pb = _q_ib;                          \</span>
<a name="l01129"></a>01129 <span class="preprocessor">                _q_p = _q_j - 1;                        \</span>
<a name="l01130"></a>01130 <span class="preprocessor">            }                                           \</span>
<a name="l01131"></a>01131 <span class="preprocessor">        }                                               \</span>
<a name="l01132"></a>01132 <span class="preprocessor">        _q_jb = _q_f + ((_q_p - 1) &gt;&gt; 1);               \</span>
<a name="l01133"></a>01133 <span class="preprocessor">        if (greater(_q_l, _q_jb)) {                     \</span>
<a name="l01134"></a>01134 <span class="preprocessor">            *_q_pb = *_q_jb;                            \</span>
<a name="l01135"></a>01135 <span class="preprocessor">            *_q_jb = *_q_l;                             \</span>
<a name="l01136"></a>01136 <span class="preprocessor">        } else                                          \</span>
<a name="l01137"></a>01137 <span class="preprocessor">            *_q_pb = *_q_l;                             \</span>
<a name="l01138"></a>01138 <span class="preprocessor">        *_q_l = _q_t;                                   \</span>
<a name="l01139"></a>01139 <span class="preprocessor">    } while (0)</span>
<a name="l01140"></a>01140 <span class="preprocessor"></span>
<a name="l01141"></a>01141 <span class="comment">/* 下滤调整：</span>
<a name="l01142"></a>01142 <span class="comment"> * (1)将first记为parent节点.</span>
<a name="l01143"></a>01143 <span class="comment"> * (2)若parent节点有两个子节点，则选出值最大节点，记为max，</span>
<a name="l01144"></a>01144 <span class="comment"> *    若parent节点仅一个子节点，则选唯一节点为最大节点，记为max，</span>
<a name="l01145"></a>01145 <span class="comment"> *    若parent节点没有子节点，则退出算法.</span>
<a name="l01146"></a>01146 <span class="comment"> * (3)若parent节点的值大于等于max节点的值，则退出算法.</span>
<a name="l01147"></a>01147 <span class="comment"> * (4)将max节点与parent节点的值进行交换.</span>
<a name="l01148"></a>01148 <span class="comment"> * (5)将max节点记为parent节点，转(2).</span>
<a name="l01149"></a>01149 <span class="comment"> * greater(i, j) 最大堆 =&gt; (*i &gt; *j) 最小堆 =&gt; (*i &lt; *j)</span>
<a name="l01150"></a>01150 <span class="comment"> */</span>
<a name="l01151"></a>01151 <span class="preprocessor">#define __slseq_adjust_heap(type, base, first, last, greater) \</span>
<a name="l01152"></a>01152 <span class="preprocessor">    do {size_t _q_j = ((first) + 1) &lt;&lt; 1;           \</span>
<a name="l01153"></a>01153 <span class="preprocessor">        type * _q_pb = (base) + (first);            \</span>
<a name="l01154"></a>01154 <span class="preprocessor">        type * _q_lb = (base) + (last);             \</span>
<a name="l01155"></a>01155 <span class="preprocessor">        type * _q_ib, * _q_jb, * _q_mb;             \</span>
<a name="l01156"></a>01156 <span class="preprocessor">        type _q_t = *_q_pb;                         \</span>
<a name="l01157"></a>01157 <span class="preprocessor">        while (_q_j &lt;= (last)) {                    \</span>
<a name="l01158"></a>01158 <span class="preprocessor">            _q_jb = (base) + _q_j;                  \</span>
<a name="l01159"></a>01159 <span class="preprocessor">            _q_ib = _q_jb - 1;                      \</span>
<a name="l01160"></a>01160 <span class="preprocessor">            if (greater(_q_jb, _q_ib)) {            \</span>
<a name="l01161"></a>01161 <span class="preprocessor">                _q_mb = _q_jb;                      \</span>
<a name="l01162"></a>01162 <span class="preprocessor">                _q_j = (_q_j + 1) &lt;&lt; 1;             \</span>
<a name="l01163"></a>01163 <span class="preprocessor">            } else {                                \</span>
<a name="l01164"></a>01164 <span class="preprocessor">                _q_mb = _q_ib;                      \</span>
<a name="l01165"></a>01165 <span class="preprocessor">                _q_j = _q_j &lt;&lt; 1;                   \</span>
<a name="l01166"></a>01166 <span class="preprocessor">            }                                       \</span>
<a name="l01167"></a>01167 <span class="preprocessor">            if (greater((&amp;_q_t), _q_mb))            \</span>
<a name="l01168"></a>01168 <span class="preprocessor">                break;                              \</span>
<a name="l01169"></a>01169 <span class="preprocessor">            *_q_pb = *_q_mb;                        \</span>
<a name="l01170"></a>01170 <span class="preprocessor">            _q_pb = _q_mb;                          \</span>
<a name="l01171"></a>01171 <span class="preprocessor">        }                                           \</span>
<a name="l01172"></a>01172 <span class="preprocessor">        if (_q_j == (last) + 1 &amp;&amp;                   \</span>
<a name="l01173"></a>01173 <span class="preprocessor">            (greater(_q_lb, (&amp;_q_t)))) {            \</span>
<a name="l01174"></a>01174 <span class="preprocessor">            *_q_pb = *_q_lb;                        \</span>
<a name="l01175"></a>01175 <span class="preprocessor">            *_q_lb = _q_t;                          \</span>
<a name="l01176"></a>01176 <span class="preprocessor">        } else                                      \</span>
<a name="l01177"></a>01177 <span class="preprocessor">            *_q_pb = _q_t;                          \</span>
<a name="l01178"></a>01178 <span class="preprocessor">    } while (0)</span>
<a name="l01179"></a>01179 <span class="preprocessor"></span>
<a name="l01196"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gac018c8a1658c075efc346e2879790117">01196</a> <span class="preprocessor">#define slseq_make_heap(type, begin, end, greater) do {\</span>
<a name="l01197"></a>01197 <span class="preprocessor">        type * _q1_f = (type *)(begin);                                 \</span>
<a name="l01198"></a>01198 <span class="preprocessor">        size_t _q1_l = (type *)(end) - _q1_f - 1;                       \</span>
<a name="l01199"></a>01199 <span class="preprocessor">        size_t _q1_i = ((_q1_l - 1) &gt;&gt; 1) + 1;                          \</span>
<a name="l01200"></a>01200 <span class="preprocessor">        while (_q1_i--)                                                 \</span>
<a name="l01201"></a>01201 <span class="preprocessor">            __slseq_adjust_heap(type, _q1_f, _q1_i, _q1_l, greater);    \</span>
<a name="l01202"></a>01202 <span class="preprocessor">    } while (0)</span>
<a name="l01203"></a>01203 <span class="preprocessor"></span>
<a name="l01218"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga0d6c768ed5c27f8dd419179f98842055">01218</a> <span class="preprocessor">#define slseq_sort_heap(type, begin, end, greater) do {     \</span>
<a name="l01219"></a>01219 <span class="preprocessor">        type * _q1_e = (end);                               \</span>
<a name="l01220"></a>01220 <span class="preprocessor">        type * _q1_f = (begin);                             \</span>
<a name="l01221"></a>01221 <span class="preprocessor">        while (_q1_e &gt; _q1_f + 1) {                         \</span>
<a name="l01222"></a>01222 <span class="preprocessor">            slseq_pop_heap(type, _q1_f, _q1_e--, greater);  \</span>
<a name="l01223"></a>01223 <span class="preprocessor">        }                                                   \</span>
<a name="l01224"></a>01224 <span class="preprocessor">    } while (0)</span>
<a name="l01225"></a>01225 <span class="preprocessor"></span>
<a name="l01234"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaacbbb83c02c780331146eeb3593564e5">01234</a> <span class="preprocessor">#define slseq_shuffle(type, begin, end, _RAND) do {         \</span>
<a name="l01235"></a>01235 <span class="preprocessor">        type * _q_l = (type *)(end) - 1;                    \</span>
<a name="l01236"></a>01236 <span class="preprocessor">        type * _q_f = (type *)(begin);                      \</span>
<a name="l01237"></a>01237 <span class="preprocessor">        for (; _q_l &gt; _q_f; --_q_l) {                       \</span>
<a name="l01238"></a>01238 <span class="preprocessor">            type * _q_n = _q_f +                            \</span>
<a name="l01239"></a>01239 <span class="preprocessor">                ((_RAND) % ((_q_l - _q_f) + 1));           \</span>
<a name="l01240"></a>01240 <span class="preprocessor">            if (_q_l &gt; _q_n)                                \</span>
<a name="l01241"></a>01241 <span class="preprocessor">                __slseq_iter_swap(type, _q_l, _q_n);        \</span>
<a name="l01242"></a>01242 <span class="preprocessor">        }                                                   \</span>
<a name="l01243"></a>01243 <span class="preprocessor">    } while (0)</span>
<a name="l01244"></a>01244 <span class="preprocessor"></span>
<a name="l01253"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaaded310138fd7f72a08cde3239155066">01253</a> <span class="preprocessor">#define slseq_sort_insert(type, head, begin, end, newly, greater_equal) \</span>
<a name="l01254"></a>01254 <span class="preprocessor">    do {type _q_n = (newly);                    \</span>
<a name="l01255"></a>01255 <span class="preprocessor">        type * _q_e = (end);                    \</span>
<a name="l01256"></a>01256 <span class="preprocessor">        type * _q_f = (begin);                  \</span>
<a name="l01257"></a>01257 <span class="preprocessor">        for (; _q_f &lt; _q_e; ++_q_f) {           \</span>
<a name="l01258"></a>01258 <span class="preprocessor">            if (greater_equal(_q_f, (&amp;_q_n)))   \</span>
<a name="l01259"></a>01259 <span class="preprocessor">                break;                          \</span>
<a name="l01260"></a>01260 <span class="preprocessor">        }                                       \</span>
<a name="l01261"></a>01261 <span class="preprocessor">        slseq_insert(type, head, _q_f, _q_n);   \</span>
<a name="l01262"></a>01262 <span class="preprocessor">    } while (0)</span>
<a name="l01263"></a>01263 <span class="preprocessor"></span>
<a name="l01276"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga020d376fc469108db771c67254e95f0e">01276</a> <span class="preprocessor">#define slseq_is_sorted(type, begin, end, greater_equal, res) \</span>
<a name="l01277"></a>01277 <span class="preprocessor">    do {type * _q_e = (end);                            \</span>
<a name="l01278"></a>01278 <span class="preprocessor">        type * _q_i = (begin);                          \</span>
<a name="l01279"></a>01279 <span class="preprocessor">        for ((res) = 1; _q_i + 1 &lt; _q_e; ++_q_i) {      \</span>
<a name="l01280"></a>01280 <span class="preprocessor">            if (!(greater_equal((_q_i + 1), _q_i))) {   \</span>
<a name="l01281"></a>01281 <span class="preprocessor">                (res) = 0; break;                       \</span>
<a name="l01282"></a>01282 <span class="preprocessor">            }                                           \</span>
<a name="l01283"></a>01283 <span class="preprocessor">        }                                               \</span>
<a name="l01284"></a>01284 <span class="preprocessor">    } while (0)</span>
<a name="l01285"></a>01285 <span class="preprocessor"></span>
<a name="l01295"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga1e1750218cc40b4b638c0b8560ae3f81">01295</a> <span class="preprocessor">#define slseq_bubble_sort(type, begin, end, greater) do {   \</span>
<a name="l01296"></a>01296 <span class="preprocessor">        int _q_pc = 1;                                      \</span>
<a name="l01297"></a>01297 <span class="preprocessor">        type * _q_l = (end) - 1;                            \</span>
<a name="l01298"></a>01298 <span class="preprocessor">        type * _q_i = (begin);                              \</span>
<a name="l01299"></a>01299 <span class="preprocessor">        for (; _q_pc &amp;&amp; _q_i &lt; _q_l; ++_q_i) {              \</span>
<a name="l01300"></a>01300 <span class="preprocessor">            type * _q_j = _q_l - 1;                         \</span>
<a name="l01301"></a>01301 <span class="preprocessor">            for (_q_pc = 0; _q_j &gt;= _q_i; --_q_j) {         \</span>
<a name="l01302"></a>01302 <span class="preprocessor">                type * _q_k = _q_j + 1;                     \</span>
<a name="l01303"></a>01303 <span class="preprocessor">                if (greater(_q_j, _q_k)) {                  \</span>
<a name="l01304"></a>01304 <span class="preprocessor">                    __slseq_iter_swap(type, _q_j, _q_k);    \</span>
<a name="l01305"></a>01305 <span class="preprocessor">                    _q_pc = 1;                              \</span>
<a name="l01306"></a>01306 <span class="preprocessor">                }                                           \</span>
<a name="l01307"></a>01307 <span class="preprocessor">            }                                               \</span>
<a name="l01308"></a>01308 <span class="preprocessor">        }                                                   \</span>
<a name="l01309"></a>01309 <span class="preprocessor">    } while (0)</span>
<a name="l01310"></a>01310 <span class="preprocessor"></span>
<a name="l01320"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaac67765fe2abd1fb4a19b2ca396090bc">01320</a> <span class="preprocessor">#define slseq_oddeven_sort(type, begin, end, greater) do {  \</span>
<a name="l01321"></a>01321 <span class="preprocessor">        int _q_pc = 1;                                      \</span>
<a name="l01322"></a>01322 <span class="preprocessor">        type * _q_l = (end) - 1;                            \</span>
<a name="l01323"></a>01323 <span class="preprocessor">        type * _q_f = (begin);                              \</span>
<a name="l01324"></a>01324 <span class="preprocessor">        while (_q_pc) {                                     \</span>
<a name="l01325"></a>01325 <span class="preprocessor">            int _q_w; _q_pc = 0;                            \</span>
<a name="l01326"></a>01326 <span class="preprocessor">            for (_q_w = 0; _q_w &lt; 2; ++_q_w)                \</span>
<a name="l01327"></a>01327 <span class="preprocessor">                __slseq_oddeven_scan(_q_w, type, greater);  \</span>
<a name="l01328"></a>01328 <span class="preprocessor">        }                                                   \</span>
<a name="l01329"></a>01329 <span class="preprocessor">    } while (0)</span>
<a name="l01330"></a>01330 <span class="preprocessor"></span>
<a name="l01331"></a>01331 <span class="preprocessor">#define __slseq_oddeven_scan(start, type, greater) do { \</span>
<a name="l01332"></a>01332 <span class="preprocessor">        type * _q_i = _q_f + start;                     \</span>
<a name="l01333"></a>01333 <span class="preprocessor">        while (_q_i &lt; _q_l) {                           \</span>
<a name="l01334"></a>01334 <span class="preprocessor">            type * _q_j = _q_i + 1;                     \</span>
<a name="l01335"></a>01335 <span class="preprocessor">            if (greater(_q_i, _q_j)) {                  \</span>
<a name="l01336"></a>01336 <span class="preprocessor">                __slseq_iter_swap(type, _q_i, _q_j);    \</span>
<a name="l01337"></a>01337 <span class="preprocessor">                _q_pc = 1;                              \</span>
<a name="l01338"></a>01338 <span class="preprocessor">            }                                           \</span>
<a name="l01339"></a>01339 <span class="preprocessor">            _q_i += 2;                                  \</span>
<a name="l01340"></a>01340 <span class="preprocessor">        }                                               \</span>
<a name="l01341"></a>01341 <span class="preprocessor">    } while (0)</span>
<a name="l01342"></a>01342 <span class="preprocessor"></span>
<a name="l01352"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga6c2394714ca5cbce53c4922518891d1a">01352</a> <span class="preprocessor">#define slseq_cocktail_sort(type, begin, end, greater) do { \</span>
<a name="l01353"></a>01353 <span class="preprocessor">        int _q_pc;                                          \</span>
<a name="l01354"></a>01354 <span class="preprocessor">        type * _q_l = (end) - 1;                            \</span>
<a name="l01355"></a>01355 <span class="preprocessor">        type * _q_f = (begin);                              \</span>
<a name="l01356"></a>01356 <span class="preprocessor">        do {                                                \</span>
<a name="l01357"></a>01357 <span class="preprocessor">            type * _q_i = _q_f;                             \</span>
<a name="l01358"></a>01358 <span class="preprocessor">            for (_q_pc = 0; _q_i &lt; _q_l; ++_q_i) {          \</span>
<a name="l01359"></a>01359 <span class="preprocessor">                type * _q_j = _q_i + 1;                     \</span>
<a name="l01360"></a>01360 <span class="preprocessor">                if (greater(_q_i, _q_j)) {                  \</span>
<a name="l01361"></a>01361 <span class="preprocessor">                    __slseq_iter_swap(type, _q_i, _q_j);    \</span>
<a name="l01362"></a>01362 <span class="preprocessor">                    _q_pc = 1;                              \</span>
<a name="l01363"></a>01363 <span class="preprocessor">                }                                           \</span>
<a name="l01364"></a>01364 <span class="preprocessor">            }                                               \</span>
<a name="l01365"></a>01365 <span class="preprocessor">            for (_q_i = --_q_l; _q_i &gt; _q_f; --_q_i) {      \</span>
<a name="l01366"></a>01366 <span class="preprocessor">                type * _q_j = _q_i - 1;                     \</span>
<a name="l01367"></a>01367 <span class="preprocessor">                if (greater(_q_j, _q_i)) {                  \</span>
<a name="l01368"></a>01368 <span class="preprocessor">                    __slseq_iter_swap(type, _q_i, _q_j);    \</span>
<a name="l01369"></a>01369 <span class="preprocessor">                    _q_pc = 1;                              \</span>
<a name="l01370"></a>01370 <span class="preprocessor">                }                                           \</span>
<a name="l01371"></a>01371 <span class="preprocessor">            }                                               \</span>
<a name="l01372"></a>01372 <span class="preprocessor">            ++_q_f;                                         \</span>
<a name="l01373"></a>01373 <span class="preprocessor">        } while (_q_pc);                                    \</span>
<a name="l01374"></a>01374 <span class="preprocessor">    } while (0)</span>
<a name="l01375"></a>01375 <span class="preprocessor"></span>
<a name="l01385"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gab46d83f4e41d78b5f66e6b320a2cf90f">01385</a> <span class="preprocessor">#define slseq_comb_sort(type, begin, end, greater) do {         \</span>
<a name="l01386"></a>01386 <span class="preprocessor">        int _q_swap = 1;                                        \</span>
<a name="l01387"></a>01387 <span class="preprocessor">        type * _q_e = (end);                                    \</span>
<a name="l01388"></a>01388 <span class="preprocessor">        type * _q_f = (begin);                                  \</span>
<a name="l01389"></a>01389 <span class="preprocessor">        size_t _q_gap = _q_e - _q_f;                            \</span>
<a name="l01390"></a>01390 <span class="preprocessor">        while (_q_gap &gt; 1 || _q_swap) {                         \</span>
<a name="l01391"></a>01391 <span class="preprocessor">            type * _q_i, * _q_j;                                \</span>
<a name="l01392"></a>01392 <span class="preprocessor">            if (_q_gap &gt; 1)                                     \</span>
<a name="l01393"></a>01393 <span class="preprocessor">                _q_gap = (size_t)(((double)_q_gap)             \</span>
<a name="l01394"></a>01394 <span class="preprocessor">                      / 1.247330950103979);                     \</span>
<a name="l01395"></a>01395 <span class="preprocessor">            _q_i = _q_f;                                        \</span>
<a name="l01396"></a>01396 <span class="preprocessor">            _q_j = _q_f + _q_gap;                               \</span>
<a name="l01397"></a>01397 <span class="preprocessor">            for (_q_swap = 0; _q_j &lt; _q_e; ++_q_i, ++_q_j) {    \</span>
<a name="l01398"></a>01398 <span class="preprocessor">                if (greater(_q_i, _q_j)) {                      \</span>
<a name="l01399"></a>01399 <span class="preprocessor">                    __slseq_iter_swap(type, _q_i, _q_j);        \</span>
<a name="l01400"></a>01400 <span class="preprocessor">                    _q_swap = 1;                                \</span>
<a name="l01401"></a>01401 <span class="preprocessor">                }                                               \</span>
<a name="l01402"></a>01402 <span class="preprocessor">            }                                                   \</span>
<a name="l01403"></a>01403 <span class="preprocessor">        }                                                       \</span>
<a name="l01404"></a>01404 <span class="preprocessor">    } while (0)</span>
<a name="l01405"></a>01405 <span class="preprocessor"></span>
<a name="l01415"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga0d29f0bfa93aa43b78cf42775b298983">01415</a> <span class="preprocessor">#define slseq_select_sort(type, begin, end, greater)    \</span>
<a name="l01416"></a>01416 <span class="preprocessor">    do {type * _q_e = (end);                            \</span>
<a name="l01417"></a>01417 <span class="preprocessor">        type * _q_i = (begin);                          \</span>
<a name="l01418"></a>01418 <span class="preprocessor">        for (; _q_i + 1 &lt; _q_e; ++_q_i) {               \</span>
<a name="l01419"></a>01419 <span class="preprocessor">            type * _q_m = _q_i;                         \</span>
<a name="l01420"></a>01420 <span class="preprocessor">            type * _q_j = _q_i + 1;                     \</span>
<a name="l01421"></a>01421 <span class="preprocessor">            for (; _q_j &lt; _q_e; ++_q_j) {               \</span>
<a name="l01422"></a>01422 <span class="preprocessor">                if (greater(_q_m, _q_j))                \</span>
<a name="l01423"></a>01423 <span class="preprocessor">                    _q_m = _q_j;                        \</span>
<a name="l01424"></a>01424 <span class="preprocessor">            }                                           \</span>
<a name="l01425"></a>01425 <span class="preprocessor">            if (_q_i != _q_m)                           \</span>
<a name="l01426"></a>01426 <span class="preprocessor">                __slseq_iter_swap(type, _q_m, _q_i);    \</span>
<a name="l01427"></a>01427 <span class="preprocessor">        }                                               \</span>
<a name="l01428"></a>01428 <span class="preprocessor">    } while (0)</span>
<a name="l01429"></a>01429 <span class="preprocessor"></span>
<a name="l01439"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gaa9aebff1f039111a070cb5c635948400">01439</a> <span class="preprocessor">#define slseq_insert_sort(type, begin, end, greater) do {   \</span>
<a name="l01440"></a>01440 <span class="preprocessor">        type * _q_l = (end) - 1;                            \</span>
<a name="l01441"></a>01441 <span class="preprocessor">        type * _q_f = (begin);                              \</span>
<a name="l01442"></a>01442 <span class="preprocessor">        type * _q_i = _q_l - 1;                             \</span>
<a name="l01443"></a>01443 <span class="preprocessor">        for (; _q_i &gt;= _q_f; --_q_i) {                      \</span>
<a name="l01444"></a>01444 <span class="preprocessor">            type * _q_j = _q_l;                             \</span>
<a name="l01445"></a>01445 <span class="preprocessor">            for (; _q_j &gt; _q_i; --_q_j) {                   \</span>
<a name="l01446"></a>01446 <span class="preprocessor">                if (greater(_q_i, _q_j)) {                  \</span>
<a name="l01447"></a>01447 <span class="preprocessor">                    type _q_t = *_q_i;                      \</span>
<a name="l01448"></a>01448 <span class="preprocessor">                    memcpy(_q_i, _q_i + 1, sizeof(type) *   \</span>
<a name="l01449"></a>01449 <span class="preprocessor">                        (_q_j - _q_i));                     \</span>
<a name="l01450"></a>01450 <span class="preprocessor">                    *_q_j = _q_t;                           \</span>
<a name="l01451"></a>01451 <span class="preprocessor">                    break;                                  \</span>
<a name="l01452"></a>01452 <span class="preprocessor">                }                                           \</span>
<a name="l01453"></a>01453 <span class="preprocessor">            }                                               \</span>
<a name="l01454"></a>01454 <span class="preprocessor">        }                                                   \</span>
<a name="l01455"></a>01455 <span class="preprocessor">    } while (0)</span>
<a name="l01456"></a>01456 <span class="preprocessor"></span>
<a name="l01466"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga197b786747dc3c95744f2bf8060b36ad">01466</a> <span class="preprocessor">#define slseq_shell_sort(type, begin, end, greater) \</span>
<a name="l01467"></a>01467 <span class="preprocessor">    do {type * _q_e = (end);                        \</span>
<a name="l01468"></a>01468 <span class="preprocessor">        type * _q_f = (begin);                      \</span>
<a name="l01469"></a>01469 <span class="preprocessor">        size_t _q_gap = (_q_e - _q_f) &gt;&gt; 1;         \</span>
<a name="l01470"></a>01470 <span class="preprocessor">        for (; _q_gap; _q_gap &gt;&gt;= 1) {              \</span>
<a name="l01471"></a>01471 <span class="preprocessor">            type * _q_i = _q_f + _q_gap;            \</span>
<a name="l01472"></a>01472 <span class="preprocessor">            for (; _q_i &lt; _q_e; ++_q_i) {           \</span>
<a name="l01473"></a>01473 <span class="preprocessor">                type _q_t = *_q_i;                  \</span>
<a name="l01474"></a>01474 <span class="preprocessor">                type * _q_j = _q_i - _q_gap;        \</span>
<a name="l01475"></a>01475 <span class="preprocessor">                while (_q_j &gt;= _q_f &amp;&amp;              \</span>
<a name="l01476"></a>01476 <span class="preprocessor">                    (greater(_q_j, (&amp;_q_t)))) { \</span>
<a name="l01477"></a>01477 <span class="preprocessor">                    _q_j[_q_gap] = *_q_j;           \</span>
<a name="l01478"></a>01478 <span class="preprocessor">                    _q_j -= _q_gap;                 \</span>
<a name="l01479"></a>01479 <span class="preprocessor">                }                                   \</span>
<a name="l01480"></a>01480 <span class="preprocessor">                _q_j[_q_gap] = _q_t;                \</span>
<a name="l01481"></a>01481 <span class="preprocessor">            }                                       \</span>
<a name="l01482"></a>01482 <span class="preprocessor">        }                                           \</span>
<a name="l01483"></a>01483 <span class="preprocessor">    } while (0)</span>
<a name="l01484"></a>01484 <span class="preprocessor"></span>
<a name="l01485"></a>01485 <span class="comment">/* 计数排序和鸽巢排序(仅限于有限整数序列，需事先将hole清零) */</span>
<a name="l01486"></a>01486 <span class="preprocessor">#ifndef COUNTING_SIZE</span>
<a name="l01487"></a>01487 <span class="preprocessor"></span>
<a name="l01496"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga0e81257e6808089aea04c746c3b14b0b">01496</a> <span class="preprocessor">#define COUNTING_SIZE(_min, _max) ((_max) - (_min) + 1)</span>
<a name="l01497"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gabe56db9f8a1c3e4e29a31b7597b9b59e">01497</a> <span class="preprocessor"></span><span class="preprocessor">#define PIGEONHOLE_SIZE(_max) ((_max) + 1)</span>
<a name="l01498"></a>01498 <span class="preprocessor"></span><span class="preprocessor">#endif  </span><span class="comment">/* #ifndef COUNTING_SIZE */</span>
<a name="l01499"></a>01499 
<a name="l01521"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#ga613dcb0fec0cfe35de3ce9cf50bd1a43">01521</a> <span class="preprocessor">#define slseq_counting_sort(type, begin, end, hole, _min, _max) \</span>
<a name="l01522"></a>01522 <span class="preprocessor">    do {type * _q_hole = (type *)(hole);                \</span>
<a name="l01523"></a>01523 <span class="preprocessor">        type * _q_e = (end);                            \</span>
<a name="l01524"></a>01524 <span class="preprocessor">        type * _q_f = (begin);                          \</span>
<a name="l01525"></a>01525 <span class="preprocessor">        type _q_min = (_min);                           \</span>
<a name="l01526"></a>01526 <span class="preprocessor">        type _q_cnt = (_max) - _q_min + 1;              \</span>
<a name="l01527"></a>01527 <span class="preprocessor">        type _q_i = 0;                                  \</span>
<a name="l01528"></a>01528 <span class="preprocessor">        memset(_q_hole, 0, sizeof(type) * _q_cnt);      \</span>
<a name="l01529"></a>01529 <span class="preprocessor">        while (_q_e &gt; _q_f)                             \</span>
<a name="l01530"></a>01530 <span class="preprocessor">            ++_q_hole[*(--_q_e) - _q_min];              \</span>
<a name="l01531"></a>01531 <span class="preprocessor">        for (; _q_i &lt; _q_cnt; ++_q_i) {                 \</span>
<a name="l01532"></a>01532 <span class="preprocessor">            size_t _q_c = _q_hole[_q_i];                \</span>
<a name="l01533"></a>01533 <span class="preprocessor">            while (_q_c--)                              \</span>
<a name="l01534"></a>01534 <span class="preprocessor">                *_q_f++ = _q_i;                         \</span>
<a name="l01535"></a>01535 <span class="preprocessor">        }                                               \</span>
<a name="l01536"></a>01536 <span class="preprocessor">    } while (0)</span>
<a name="l01537"></a>01537 <span class="preprocessor"></span>
<a name="l01558"></a><a class="code" href="group___xE5_x8D_x95_xE7_xAB_xAF_xE7_xBA_xBF_xE5_xBD_xA2_xE5_xBA_x8F_xE8_xA1_xA8.html#gab5df877d51d0543e548b0b575a1e83a9">01558</a> <span class="preprocessor">#define slseq_pigeonhole_sort(type, begin, end, hole, _max) \</span>
<a name="l01559"></a>01559 <span class="preprocessor">    slseq_counting_sort(type, begin, end, hole, 0, _max)</span>
<a name="l01560"></a>01560 <span class="preprocessor"></span>
<a name="l01563"></a>01563 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l01564"></a>01564 <span class="preprocessor"></span>}
<a name="l01565"></a>01565 <span class="preprocessor">#endif </span><span class="comment">/* #ifdef __cplusplus */</span>
<a name="l01566"></a>01566 
<a name="l01567"></a>01567 <span class="preprocessor">#endif </span><span class="comment">/* #ifndef __NV_SLSEQ__ */</span>
<a name="l01568"></a>01568 
</pre></div></div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>数据结构</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>类型定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>宏定义</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at 2015年七月16日 星期四 12:00:37 for Navo Portable Library by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>
